#ifndef __BTL_FINGERPRINT_UTILS_H__
#define __BTL_FINGERPRINT_UTILS_H__
#include <stdint.h>

#define ALIGN_OF(s, _align) ((s + _align - 1) & (~(_align - 1)))

#define MAKE_BYTE(a, b) (((a) >> ((b)*8)) & 0x000000ff)

#define LEN_ARRAY(a) (sizeof(a) / sizeof(a[0]))
uint16_t big_endian16(uint16_t x);
// uint32_t big_endian32(uint32_t x);
uint16_t calc_checksum_16(uint8_t* data, uint32_t len);
uint32_t calc_checksum_32(uint8_t* data, uint32_t len);
uint32_t calc_crc32(const unsigned char* s, int len);

void test_crc32(void);

#endif  // __BTL_FINGERPRINT_UTILS_H__
